#ifndef ANNIMATION_HH_
# define ANNIMATION_HH_

// NOTE: is it *RLY* a Annimation class ?
// or a 2D one ?

class Annimation
{
public:
  void play();

  /// allow to play the annimation from \param frame
  void playFromFrame(Frame frame);

  /// \return frame on which we stoped
  Frame pause();

  /** interrupt the annim (SIGKILL)
   ** => we're stuck on last frame
   */
  void kill();

  /// stop he annim (cd use a stop_annim, played on stop)
  void stop();

  void buildAnnim();


private:

  // NOTE: watch syntax, does this work ?
  // mandaory legacy ?
  union
  {
    Object _object; // 4 3D annimations
    Rectangle _rect; // 4 2D annimations
  }

  std::Vector<Frame> _frameList; // NOTE: watch type

  /** the speed at which we'd like to play it
   ** if negative, the annimation will be played in reverse
   ** meaning: from last frame to first one, at |_speed| velocity
   ** default speed in *NOT* == framerate screen
   ** default value: 1.
   */
  float _speed;

  glfwTimer _timer; // NOTE: watch type; is it usefull ?

  // on which file is the annim ?
  int fd; // NOTE: watch type / way of this, cd be a DBSumthin...

  // how many frames does the annimation content
  unsigned int _nbFrames; // NOTE: does this make sense for a 3D annim ?

  /// number of frames played from the beginning
  unsigned int _playedFrames;
};

#endif /* !ANNIMATION_HH_ */
